<cfif form.id eq 0>
	save
	<cfquery name="qmax" dbtype="query">
		SELECT ID
		from session.qtables
		order by id desc
	</cfquery>
	<cfif qmax.id eq ""><cfset nextkey = 1/><cfelse><cfset nextkey = qmax.id + 1/></cfif>
	<cfdump var="#qmax#">
	<cfset QueryAddRow(session.qtables) />
	<cfset QuerySetCell(session.qtables, "id", "#nextkey#") />
	<cfset QuerySetCell(session.qtables, "object", form.object) />
	<cfset QuerySetCell(session.qtables, "pk", form.pk) />
	<cfset QuerySetCell(session.qtables, "dbtype", form.dbtype) />
	<cfdump var="#session.qtables#">
	<cfdump var="#form#">
<cfelse>
	update
	<cfquery name="session.qtables" dbtype="query">
		select 	id,object,pk,dbtype
		from  	session.qtables
		WHERE 	not id =  '#form.id#'
		union 
		select 	'#form.id#' as id,
				'#form.object#' as object, 
				'#form.pk#' as pk,
				'#form.dbtype#' as dbtype
		from 	session.qtables
		where 	id = '#form.id#'
	</cfquery>
</cfif>
<cflocation url="savewebservices.cfm"/>
